package com.ygh.medical.controller;

import com.ygh.medical.entity.Person;
import com.ygh.medical.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("person")
public class PersonController {

    @Autowired
    private PersonService personService;

    @GetMapping("userInfo")
    public Person getUserInfo(String username){
        return personService.findByName(username);
    }
}
